package com.jia.sms.holder;

import com.jia.sms.entity.User;

/**
 * @author jia
 */
public class UserHolder {

    private static final ThreadLocal<User> USER_HOLDER = new ThreadLocal<>();

    public static void saveUser(User user) {
        USER_HOLDER.set(user);
    }

    public static User getUser() {
        return USER_HOLDER.get();
    }

    public static void removeUser() {
        USER_HOLDER.remove();
    }
}
